import { createApp } from 'vue'
import App from './App.vue'

import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn' // 引入中文语言包
import 'element-plus/dist/index.css'
import './styles/index.scss'

import { createPinia } from 'pinia'
import persist from 'pinia-plugin-persistedstate' // 引入持久化插件
import router from './router'
import { regAllDirectives } from './directives'

const app = createApp(App)

app.use(ElementPlus, { locale: zhCn }) // 使用element-plus --- 配置中文语言包

const pinia = createPinia()
pinia.use(persist) // 使用持久化插件

app.use(pinia)
app.use(router)

// 注册所有自定义指令
regAllDirectives(app)

app.mount('#app')